#ifndef _CTYPE_H_
#define _CTYPE_H_

typedef unsigned char	u8;

typedef unsigned short	u16;

typedef unsigned int	u32;

typedef	unsigned long	ulong;

typedef int		s32;

typedef short	s16;

typedef char	s8;

typedef char*	str;

typedef void*	cpoint;

typedef bool	cbool;

#define G_TYPE_CHECK_INSTANCE_CAST(instance,g_type,c_type)	((c_type*)g_type_check_instance_cast((CObject *)instance, g_type))
#define G_TYPE_CHECK_CLASS_CAST(g_class, g_type, c_type)	((c_type*)g_type_check_class_cast((CObjectClass *)g_class,g_type))
#define	G_TYPE_CHECK_INSTANCE_TYPE(instance,g_type)			(g_type_check_instance_is_a((CObject *)instance,g_type))
#define	G_TYPE_CHECK_CLASS_TYPE(g_class,g_type)				(g_type_check_class_is_a((CObjectClass *)g_class,g_type))
#define	G_TYPE_INSTANCE_GET_CLASS(instance, g_type, c_type)	((c_type*)g_type_get_instance_class((CObject *)instance,g_type))
#define	G_TYPE_GET_PARENT_CLASS(g_class,c_type)				((c_type*)g_type_class_peek_parent((CObjectClass *)g_class))

#define TOP_OBJECT_TYPE  				0
#define COBJECT_TYPE                 	(get_cobject_type())
#define COBJECT(obj)                 	(G_TYPE_CHECK_INSTANCE_CAST ((obj), COBJECT_TYPE, CObject))
#define COBJECT_CLASS(vclass)       	(G_TYPE_CHECK_CLASS_CAST ((vclass), COBJECT_TYPE, CObjectClass))
#define IS_COBJECT(obj)              	(G_TYPE_CHECK_INSTANCE_TYPE ((obj), COBJECT_TYPE))
#define IS_COBJECT_CLASS(vclass)      	(G_TYPE_CHECK_CLASS_TYPE ((vclass), COBJECT_TYPE))
#define COBJECT_GET_CLASS(obj)       	(G_TYPE_INSTANCE_GET_CLASS ((obj), COBJECT_TYPE, CObjectClass))

//#define NULL    ((void *)0)

#endif //_CTYPE_H_